{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2023-12-28T12:39:31.210408600Z",
     "start_time": "2023-12-28T12:39:31.195328600Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "df = pd.read_csv('../static/data/house_info_pre.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "outputs": [
    {
     "data": {
      "text/plain": "{'label': ['3室2厅2卫',\n  '4室1厅1卫',\n  '1室1厅1卫',\n  '3室2厅1卫',\n  '2室1厅1卫',\n  '4室2厅2卫',\n  '2室2厅1卫',\n  '1室0厅1卫',\n  '3室1厅1卫',\n  '5室1厅1卫'],\n 'data': [379, 372, 281, 277, 240, 200, 193, 157, 154, 84]}"
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_bar = df[df['house_type'] != '无'].groupby('house_type')['title'].count().sort_values(\n",
    "    ascending=False).reset_index().head(10)\n",
    "label = [i[0] for i in df_bar.values]\n",
    "data = [i[1] for i in df_bar.values]\n",
    "{\n",
    "    'label': label,\n",
    "    'data': data\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-28T12:39:31.244212100Z",
     "start_time": "2023-12-28T12:39:31.213401Z"
    }
   },
   "id": "f02e3a9cea2fc12f"
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "outputs": [
    {
     "data": {
      "text/plain": "{'data': [{'name': '中楼层', 'value': 1011},\n  {'name': '高楼层', 'value': 913},\n  {'name': '低楼层', 'value': 769}]}"
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_pie = df[df['floor'] != '无'].groupby('floor')['title'].count().sort_values(ascending=False).reset_index()\n",
    "data = [{'name': i[0], 'value': i[1]} for i in df_pie.values]\n",
    "{\n",
    "    'data': data\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-28T12:39:31.244212100Z",
     "start_time": "2023-12-28T12:39:31.222594600Z"
    }
   },
   "id": "94194d74ecd68ecc"
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "outputs": [
    {
     "data": {
      "text/plain": "{'label': ['中楼层', '低楼层', '高楼层'],\n 'data': [[4800,\n   6300,\n   1730,\n   4500,\n   3600,\n   7600,\n   9500,\n   5800,\n   7700,\n   5200,\n   2030,\n   3200,\n   1690,\n   2090,\n   3300,\n   9500,\n   6800,\n   17500,\n   12000,\n   3000,\n   2600,\n   10500,\n   1690,\n   2090,\n   14000,\n   3200,\n   2600,\n   9800,\n   6000,\n   4800,\n   4400,\n   5500,\n   9500,\n   3200,\n   6000,\n   4700,\n   1900,\n   4600,\n   2600,\n   4600,\n   10500,\n   7000,\n   9500,\n   2300,\n   2300,\n   1300,\n   25000,\n   12000,\n   2000,\n   15000,\n   4000,\n   3400,\n   9500,\n   2060,\n   2230,\n   19000,\n   20000,\n   2230,\n   8000,\n   1860,\n   8000,\n   2000,\n   1460,\n   4600,\n   3000,\n   9000,\n   1790,\n   17000,\n   2190,\n   5700,\n   5800,\n   6690,\n   21000,\n   2090,\n   1890,\n   1490,\n   1830,\n   7400,\n   8500,\n   5300,\n   9000,\n   7200,\n   4500,\n   3900,\n   2200,\n   3800,\n   4300,\n   18000,\n   2900,\n   8500,\n   2700,\n   5800,\n   5800,\n   2500,\n   7500,\n   3400,\n   3800,\n   5300,\n   1690,\n   2130,\n   5200,\n   7000,\n   2200,\n   5300,\n   1290,\n   6800,\n   5500,\n   9000,\n   5500,\n   5400,\n   6000,\n   4900,\n   12000,\n   5000,\n   13000,\n   4300,\n   2030,\n   8500,\n   3590,\n   2290,\n   12000,\n   3800,\n   18000,\n   4090,\n   15000,\n   6000,\n   1830,\n   14500,\n   6500,\n   1690,\n   2490,\n   5300,\n   45000,\n   3400,\n   4600,\n   3900,\n   4700,\n   9200,\n   2200,\n   4000,\n   16500,\n   2860,\n   3690,\n   9000,\n   6000,\n   13000,\n   2500,\n   15000,\n   8900,\n   17000,\n   6000,\n   5800,\n   2150,\n   18000,\n   15500,\n   5300,\n   3700,\n   7400,\n   38000,\n   16000,\n   14500,\n   2490,\n   3190,\n   5600,\n   3600,\n   6200,\n   5800,\n   1890,\n   9500,\n   14000,\n   14500,\n   4000,\n   8800,\n   9500,\n   5500,\n   8200,\n   4200,\n   5200,\n   3000,\n   2300,\n   7800,\n   13000,\n   4500,\n   3500,\n   4600,\n   7500,\n   5800,\n   14000,\n   48000,\n   7400,\n   3660,\n   1900,\n   2300,\n   8160,\n   2430,\n   8200,\n   3600,\n   1230,\n   5500,\n   7800,\n   7700,\n   1590,\n   6200,\n   2460,\n   1960,\n   4600,\n   7300,\n   7000,\n   4800,\n   4000,\n   4000,\n   2900,\n   6000,\n   5800,\n   7000,\n   3400,\n   2900,\n   3400,\n   12000,\n   5500,\n   9000,\n   5400,\n   5200,\n   3100,\n   4300,\n   7800,\n   5200,\n   15500,\n   1790,\n   12500,\n   4300,\n   12000,\n   3600,\n   7230,\n   10000,\n   10500,\n   2500,\n   2360,\n   3700,\n   6900,\n   6800,\n   4900,\n   3000,\n   5800,\n   6800,\n   3400,\n   4100,\n   5800,\n   16000,\n   7000,\n   4200,\n   10090,\n   8200,\n   4230,\n   5000,\n   15000,\n   2730,\n   4300,\n   8000,\n   15000,\n   7500,\n   12000,\n   1460,\n   2130,\n   1830,\n   5030,\n   4000,\n   7800,\n   6500,\n   5700,\n   3200,\n   3000,\n   2660,\n   7000,\n   1830,\n   3500,\n   3800,\n   4300,\n   8000,\n   2190,\n   2090,\n   1890,\n   2900,\n   3800,\n   14000,\n   5500,\n   1590,\n   16800,\n   5500,\n   4300,\n   3200,\n   11830,\n   2690,\n   1197,\n   2030,\n   7200,\n   4200,\n   9500,\n   6500,\n   4000,\n   1630,\n   2460,\n   5500,\n   3260,\n   3500,\n   2660,\n   4800,\n   3800,\n   2403,\n   2130,\n   1530,\n   90000,\n   4700,\n   6500,\n   2880,\n   1830,\n   6000,\n   3600,\n   13000,\n   3800,\n   6800,\n   5400,\n   6000,\n   12500,\n   5300,\n   4600,\n   8000,\n   3800,\n   3200,\n   2200,\n   3300,\n   6500,\n   8200,\n   10500,\n   16500,\n   2100,\n   5800,\n   4000,\n   7300,\n   7500,\n   7600,\n   3800,\n   6600,\n   13000,\n   9000,\n   3600,\n   3800,\n   90000,\n   6000,\n   3800,\n   7600,\n   6200,\n   6000,\n   2600,\n   6200,\n   5800,\n   4500,\n   2000,\n   1030,\n   11300,\n   5200,\n   5000,\n   3930,\n   2150,\n   2390,\n   1890,\n   7500,\n   3800,\n   3500,\n   6130,\n   4100,\n   5800,\n   1690,\n   2390,\n   3390,\n   6800,\n   1230,\n   33000,\n   1200,\n   4000,\n   2030,\n   4000,\n   7500,\n   7800,\n   1450,\n   1900,\n   1690,\n   1700,\n   7400,\n   5800,\n   7500,\n   20000,\n   6800,\n   1860,\n   4200,\n   3190,\n   5000,\n   2580,\n   7500,\n   5300,\n   7500,\n   6300,\n   6000,\n   2800,\n   4300,\n   2930,\n   3900,\n   4300,\n   5200,\n   9700,\n   9500,\n   1690,\n   8000,\n   6200,\n   2800,\n   5600,\n   1690,\n   7430,\n   7500,\n   2090,\n   2260,\n   2600,\n   11000,\n   2800,\n   6700,\n   4600,\n   2360,\n   2365,\n   6800,\n   6000,\n   9800,\n   7800,\n   4500,\n   7000,\n   1630,\n   4000,\n   8500,\n   3500,\n   4900,\n   4000,\n   1790,\n   8000,\n   9300,\n   8500,\n   6500,\n   4500,\n   6500,\n   2500,\n   3500,\n   8300,\n   2500,\n   22000,\n   3500,\n   2800,\n   2130,\n   6900,\n   10800,\n   1390,\n   5500,\n   9500,\n   4900,\n   5600,\n   8500,\n   4800,\n   6000,\n   10000,\n   7180,\n   7200,\n   11000,\n   2500,\n   2290,\n   4000,\n   5600,\n   24000,\n   10000,\n   5600,\n   6000,\n   9300,\n   6800,\n   5800,\n   7500,\n   4300,\n   1560,\n   1960,\n   1700,\n   1400,\n   6600,\n   5000,\n   7300,\n   3500,\n   2060,\n   4200,\n   3200,\n   4000,\n   7600,\n   5000,\n   6000,\n   2700,\n   6000,\n   15000,\n   32000,\n   4800,\n   2900,\n   55000,\n   6500,\n   11000,\n   6800,\n   3600,\n   9500,\n   5500,\n   7500,\n   10000,\n   4500,\n   13000,\n   1800,\n   3200,\n   15000,\n   5500,\n   6600,\n   24000,\n   3800,\n   4200,\n   4880,\n   35000,\n   9000,\n   4500,\n   2590,\n   2330,\n   5700,\n   11000,\n   6000,\n   6500,\n   3400,\n   2163,\n   8900,\n   3500,\n   3900,\n   12000,\n   2000,\n   9000,\n   2530,\n   1950,\n   4200,\n   4800,\n   4500,\n   7000,\n   60000,\n   5760,\n   9000,\n   2130,\n   1930,\n   1860,\n   6000,\n   3200,\n   2990,\n   9500,\n   1860,\n   1930,\n   4400,\n   5500,\n   3500,\n   6300,\n   3200,\n   6000,\n   4800,\n   5000,\n   6600,\n   3000,\n   5600,\n   5800,\n   5300,\n   3200,\n   3600,\n   2060,\n   1630,\n   8500,\n   2600,\n   1990,\n   1790,\n   4200,\n   8000,\n   1560,\n   6000,\n   2300,\n   4800,\n   3000,\n   3000,\n   3400,\n   12500,\n   4200,\n   4200,\n   5500,\n   4400,\n   2700,\n   2800,\n   7500,\n   1590,\n   4500,\n   1330,\n   3500,\n   25000,\n   40000,\n   1790,\n   6300,\n   4800,\n   4200,\n   13000,\n   2000,\n   2890,\n   2030,\n   1760,\n   2593,\n   6200,\n   1260,\n   2023,\n   7300,\n   1860,\n   2230,\n   9600,\n   5500,\n   5200,\n   1360,\n   3400,\n   2260,\n   5000,\n   23000,\n   1460,\n   15490,\n   5000,\n   3600,\n   2300,\n   10500,\n   11000,\n   45000,\n   3200,\n   2030,\n   4130,\n   4000,\n   3200,\n   2530,\n   7000,\n   7000,\n   4500,\n   1460,\n   16000,\n   12000,\n   6500,\n   8000,\n   1830,\n   4800,\n   7000,\n   8600,\n   14000,\n   3500,\n   10800,\n   1730,\n   2030,\n   8200,\n   2230,\n   50000,\n   2260,\n   6000,\n   1985,\n   3630,\n   1830,\n   1190,\n   1950,\n   8500,\n   5900,\n   2090,\n   4000,\n   2800,\n   31500,\n   1660,\n   7200,\n   8500,\n   9000,\n   6500,\n   9300,\n   7000,\n   35000,\n   7500,\n   11000,\n   1660,\n   2390,\n   7500,\n   4200,\n   1590,\n   2500,\n   2200,\n   2900,\n   15300,\n   8500,\n   1960,\n   1300,\n   2400,\n   7500,\n   12000,\n   3890,\n   5300,\n   5400,\n   4200,\n   6500,\n   2490,\n   3900,\n   1530,\n   4200,\n   20000,\n   2060,\n   4300,\n   10500,\n   6200,\n   1960,\n   9000,\n   1490,\n   5200,\n   3800,\n   6500,\n   1890,\n   4500,\n   9360,\n   2800,\n   18000,\n   6500,\n   30000,\n   5000,\n   2030,\n   2390,\n   7000,\n   1890,\n   7200,\n   6000,\n   5800,\n   2660,\n   1833,\n   4000,\n   2260,\n   1530,\n   1730,\n   1890,\n   2500,\n   6000,\n   35000,\n   4730,\n   6600,\n   3390,\n   1630,\n   5200,\n   6000,\n   2530,\n   5600,\n   2890,\n   12200,\n   2300,\n   1630,\n   8000,\n   1800,\n   14000,\n   3700,\n   6700,\n   1767,\n   6300,\n   1605,\n   3600,\n   1400,\n   12000,\n   1630,\n   2900,\n   7000,\n   3800,\n   2500,\n   2800,\n   3500,\n   2030,\n   1590,\n   3700,\n   8000,\n   1930,\n   3600,\n   1990,\n   1130,\n   9000,\n   2060,\n   1990,\n   6500,\n   3100,\n   22000,\n   8800,\n   12000,\n   7800,\n   5500,\n   1900,\n   13500,\n   5500,\n   1650,\n   8800,\n   2100,\n   6500,\n   4130,\n   1190,\n   1960,\n   6500,\n   3200,\n   2700,\n   6500,\n   14000,\n   1690,\n   1760,\n   2430,\n   3600,\n   7000,\n   1590,\n   6500,\n   3260,\n   6200,\n   4500,\n   7300,\n   7000,\n   8000,\n   12000,\n   4000,\n   2660,\n   6300,\n   3500,\n   2403,\n   8500,\n   5660,\n   9000,\n   1560,\n   3100,\n   6290,\n   22000,\n   5200,\n   35000,\n   1490,\n   1700,\n   3999,\n   1730,\n   2800,\n   2900,\n   1348,\n   14500,\n   1760,\n   3900,\n   5660,\n   3100,\n   5000,\n   1560,\n   29800,\n   3000,\n   9000,\n   7200,\n   4400,\n   3600,\n   5300,\n   5800,\n   5700,\n   5200,\n   1690,\n   3900,\n   28000,\n   4200,\n   25000,\n   2130,\n   4000,\n   4200,\n   6100,\n   1830,\n   1390,\n   4000,\n   1360,\n   11000,\n   9500,\n   3000,\n   6800,\n   10500,\n   18000,\n   5200,\n   3200,\n   6000,\n   2500,\n   1500,\n   8000,\n   7300,\n   11830,\n   2050,\n   4000,\n   4600,\n   6800,\n   9500,\n   6300,\n   5890,\n   2400,\n   6500,\n   4890,\n   6000,\n   2690,\n   4200,\n   4500,\n   4300,\n   3800,\n   30000,\n   9000,\n   3100,\n   5000,\n   3500,\n   15000,\n   3500,\n   3800,\n   1930,\n   10800,\n   3600,\n   8450,\n   4100,\n   3360,\n   5000,\n   5000,\n   2690,\n   1890,\n   12500,\n   8500,\n   3800,\n   3500,\n   8800,\n   1380,\n   4000,\n   7500,\n   7000,\n   2860,\n   3690,\n   14000,\n   6300,\n   5300,\n   6500,\n   3100,\n   1430,\n   3560,\n   1730,\n   6800,\n   3580,\n   7500,\n   5000,\n   3800,\n   3200,\n   7000,\n   6800,\n   4900,\n   2760,\n   3500,\n   4060,\n   3200,\n   2500,\n   21000,\n   6300,\n   3200,\n   3430,\n   4000,\n   3200,\n   2200,\n   9000,\n   2490,\n   10000,\n   22000,\n   1830,\n   3290,\n   14500,\n   26000,\n   4800,\n   2030,\n   1990,\n   8300,\n   1530,\n   4600,\n   5000,\n   5100,\n   4200,\n   2500,\n   3600,\n   2060,\n   9000,\n   6500,\n   2190,\n   5230,\n   2230,\n   10000,\n   1730,\n   2930,\n   2500,\n   2030,\n   3000,\n   4000,\n   4300,\n   4500,\n   3500,\n   5000,\n   2690,\n   1960,\n   6500,\n   11000,\n   5600,\n   ...],\n  [8200,\n   5500,\n   6000,\n   3700,\n   3700,\n   10000,\n   5200,\n   18000,\n   8000,\n   6000,\n   11500,\n   7200,\n   10500,\n   2200,\n   5500,\n   27000,\n   28000,\n   17000,\n   7100,\n   24100,\n   3500,\n   24100,\n   5000,\n   6000,\n   5200,\n   6700,\n   3000,\n   5500,\n   12500,\n   17000,\n   2200,\n   3500,\n   4500,\n   21000,\n   6300,\n   50000,\n   3000,\n   5500,\n   3500,\n   11000,\n   1860,\n   4400,\n   4800,\n   2690,\n   16800,\n   2590,\n   9300,\n   5200,\n   3200,\n   3600,\n   1430,\n   5500,\n   4600,\n   1500,\n   14000,\n   2730,\n   4200,\n   4800,\n   4690,\n   1930,\n   1800,\n   1130,\n   41000,\n   2300,\n   15500,\n   7000,\n   3530,\n   8000,\n   38000,\n   6000,\n   4830,\n   1190,\n   3260,\n   3300,\n   3300,\n   5500,\n   5500,\n   14000,\n   11000,\n   14000,\n   5500,\n   8800,\n   3500,\n   39800,\n   50000,\n   15000,\n   80000,\n   18000,\n   11550,\n   5800,\n   20000,\n   1577,\n   1230,\n   1460,\n   6300,\n   6000,\n   2830,\n   6000,\n   6800,\n   1484,\n   4800,\n   3300,\n   4500,\n   6200,\n   7450,\n   1630,\n   1890,\n   4900,\n   1500,\n   1930,\n   2200,\n   13500,\n   5160,\n   7200,\n   17000,\n   18000,\n   4000,\n   1890,\n   1930,\n   30000,\n   6500,\n   1830,\n   2230,\n   2330,\n   6600,\n   1860,\n   1930,\n   6500,\n   60000,\n   5700,\n   5800,\n   1890,\n   1960,\n   12000,\n   7800,\n   7500,\n   11000,\n   4200,\n   1960,\n   5000,\n   4200,\n   3650,\n   7000,\n   1860,\n   3130,\n   6000,\n   1830,\n   5200,\n   8500,\n   6600,\n   3600,\n   16000,\n   6600,\n   3900,\n   3600,\n   13000,\n   2000,\n   2600,\n   4450,\n   8200,\n   17000,\n   8300,\n   8000,\n   4200,\n   6260,\n   3500,\n   3390,\n   8500,\n   3800,\n   2360,\n   11990,\n   13800,\n   12000,\n   1930,\n   1530,\n   3060,\n   3000,\n   5300,\n   5300,\n   9200,\n   2000,\n   3500,\n   3000,\n   5600,\n   4300,\n   3000,\n   9000,\n   7500,\n   9000,\n   5200,\n   2500,\n   1990,\n   3000,\n   7200,\n   1830,\n   5600,\n   2260,\n   9500,\n   5500,\n   6000,\n   40000,\n   50000,\n   4600,\n   6500,\n   9200,\n   2700,\n   3300,\n   5500,\n   20000,\n   7500,\n   3600,\n   10000,\n   8000,\n   3500,\n   7500,\n   4800,\n   3100,\n   1730,\n   2330,\n   3160,\n   15000,\n   1660,\n   9800,\n   4200,\n   3800,\n   3200,\n   1530,\n   2200,\n   25000,\n   28000,\n   2060,\n   4500,\n   4500,\n   6800,\n   9500,\n   5000,\n   1930,\n   4300,\n   2530,\n   1700,\n   9000,\n   3590,\n   3200,\n   5400,\n   1630,\n   2790,\n   9800,\n   8500,\n   5700,\n   2960,\n   3900,\n   4300,\n   1390,\n   12800,\n   8000,\n   2190,\n   5300,\n   1860,\n   3500,\n   2600,\n   5000,\n   2600,\n   1930,\n   12600,\n   3480,\n   19000,\n   6000,\n   7000,\n   3400,\n   7200,\n   8500,\n   12000,\n   7200,\n   13000,\n   11000,\n   9800,\n   3600,\n   10500,\n   4000,\n   7200,\n   4000,\n   15000,\n   4500,\n   9000,\n   8000,\n   14500,\n   16000,\n   8000,\n   4500,\n   5300,\n   2600,\n   5500,\n   40000,\n   4000,\n   6500,\n   15800,\n   3900,\n   3002,\n   5000,\n   10000,\n   2630,\n   32000,\n   4500,\n   3200,\n   2160,\n   5500,\n   2390,\n   5500,\n   2230,\n   15500,\n   8000,\n   5000,\n   6600,\n   6160,\n   9500,\n   7900,\n   1960,\n   1760,\n   12500,\n   3490,\n   2190,\n   3700,\n   2000,\n   9000,\n   3100,\n   6800,\n   9990,\n   5500,\n   1990,\n   4500,\n   6800,\n   7000,\n   4400,\n   1530,\n   3300,\n   2300,\n   1830,\n   2260,\n   3400,\n   16800,\n   9000,\n   5300,\n   9000,\n   1800,\n   7500,\n   11550,\n   4350,\n   20000,\n   2030,\n   6800,\n   9800,\n   6200,\n   3500,\n   3100,\n   4200,\n   7430,\n   8500,\n   1790,\n   6500,\n   10500,\n   3300,\n   2990,\n   3600,\n   3300,\n   1690,\n   6000,\n   1990,\n   5600,\n   4200,\n   4000,\n   7000,\n   2480,\n   6500,\n   15000,\n   3000,\n   4500,\n   33000,\n   6300,\n   6800,\n   4390,\n   1960,\n   6000,\n   2500,\n   29000,\n   17000,\n   12000,\n   15000,\n   8500,\n   2260,\n   6000,\n   7500,\n   14000,\n   22000,\n   1660,\n   2230,\n   1530,\n   5500,\n   28000,\n   9000,\n   8200,\n   5800,\n   29500,\n   3800,\n   16000,\n   5800,\n   4230,\n   5190,\n   2490,\n   20000,\n   6500,\n   7000,\n   5000,\n   12000,\n   6500,\n   28000,\n   16500,\n   1560,\n   2160,\n   1690,\n   4100,\n   4500,\n   6730,\n   4560,\n   6200,\n   5000,\n   7230,\n   1860,\n   25000,\n   2560,\n   4500,\n   2060,\n   4300,\n   2230,\n   4300,\n   1930,\n   5300,\n   14000,\n   13000,\n   4200,\n   3200,\n   6800,\n   2600,\n   1590,\n   9500,\n   3700,\n   6690,\n   4500,\n   5200,\n   16000,\n   11000,\n   7500,\n   7200,\n   16000,\n   120000,\n   7000,\n   4500,\n   8000,\n   5730,\n   8000,\n   6000,\n   1790,\n   4260,\n   6500,\n   6500,\n   1290,\n   5000,\n   2600,\n   4800,\n   4000,\n   10500,\n   5600,\n   6700,\n   3500,\n   3000,\n   8000,\n   4000,\n   19000,\n   2230,\n   5800,\n   6800,\n   13500,\n   1830,\n   12200,\n   1950,\n   6790,\n   1830,\n   7330,\n   4500,\n   5200,\n   12000,\n   3600,\n   4500,\n   6300,\n   6200,\n   1530,\n   1660,\n   2500,\n   2500,\n   2480,\n   1730,\n   15000,\n   2230,\n   3700,\n   11000,\n   7500,\n   7300,\n   1530,\n   1760,\n   3000,\n   7500,\n   7000,\n   6200,\n   12000,\n   15000,\n   4300,\n   8000,\n   5700,\n   3300,\n   2500,\n   10000,\n   2900,\n   20000,\n   6500,\n   8000,\n   1833,\n   6500,\n   1800,\n   21980,\n   1730,\n   2200,\n   6000,\n   1760,\n   11500,\n   4500,\n   4300,\n   8500,\n   16000,\n   10000,\n   6600,\n   5600,\n   18000,\n   4430,\n   3500,\n   13000,\n   2700,\n   6000,\n   1484,\n   6000,\n   4500,\n   7100,\n   3000,\n   8600,\n   2700,\n   12000,\n   1530,\n   5500,\n   2090,\n   5000,\n   1990,\n   13000,\n   8000,\n   5000,\n   7260,\n   8500,\n   8900,\n   3460,\n   4500,\n   12000,\n   2500,\n   7800,\n   4100,\n   4200,\n   4300,\n   18000,\n   1890,\n   20000,\n   1730,\n   7200,\n   2060,\n   9000,\n   2160,\n   7930,\n   7500,\n   13000,\n   4000,\n   11000,\n   3000,\n   1930,\n   2860,\n   1730,\n   3000,\n   8800,\n   2900,\n   1900,\n   3700,\n   35000,\n   3200,\n   2400,\n   2500,\n   5000,\n   7500,\n   2400,\n   7000,\n   5500,\n   7800,\n   2000,\n   48000,\n   16000,\n   7000,\n   1490,\n   6000,\n   3800,\n   10500,\n   2300,\n   2300,\n   6200,\n   5800,\n   6800,\n   2290,\n   6300,\n   12000,\n   5500,\n   2960,\n   19000,\n   8300,\n   1390,\n   16800,\n   12000,\n   1660,\n   6500,\n   3400,\n   8500,\n   4600,\n   3500,\n   10000,\n   1630,\n   5800,\n   3600,\n   1460,\n   5700,\n   1930,\n   1800,\n   8000,\n   4800,\n   7300,\n   5300,\n   6500,\n   3500,\n   1660,\n   4200,\n   4500,\n   9000,\n   12000,\n   5500,\n   9030,\n   14000,\n   2030,\n   3100,\n   3760,\n   12000,\n   11000,\n   2030,\n   3950,\n   1930,\n   5000,\n   1760,\n   8000,\n   17000,\n   4000,\n   5400,\n   1690,\n   7300,\n   7500,\n   5600,\n   10090,\n   15290,\n   7200,\n   1630,\n   11000,\n   6200,\n   1330,\n   2660,\n   6800,\n   13500,\n   7500,\n   5000,\n   10500,\n   49000,\n   6500,\n   3400,\n   8500,\n   4600,\n   3500,\n   8000,\n   5000,\n   4000,\n   6800,\n   8500,\n   6500,\n   13500,\n   14000,\n   2860,\n   8000,\n   3600,\n   5100,\n   8500,\n   5000,\n   1990,\n   11000,\n   5690,\n   3000,\n   16000,\n   8600,\n   1960,\n   9860,\n   10000,\n   10500,\n   2790,\n   13500,\n   9000,\n   8500,\n   1630,\n   13000,\n   10500,\n   4200,\n   12000,\n   5308,\n   9900,\n   3000,\n   1760,\n   7900,\n   7800,\n   1800,\n   2630,\n   9000,\n   1800,\n   10000,\n   8000,\n   4200,\n   5400,\n   6500,\n   8500,\n   3600,\n   7000,\n   14250,\n   3960,\n   7800,\n   3600,\n   11300,\n   9600,\n   5300,\n   3900,\n   1960,\n   6730,\n   6460,\n   4500,\n   2360,\n   8500,\n   11000,\n   7800,\n   2330,\n   1530,\n   2400,\n   7000,\n   7000,\n   2030,\n   6300,\n   5500,\n   2650],\n  [7000,\n   6500,\n   11000,\n   9000,\n   6800,\n   3900,\n   11000,\n   4000,\n   9500,\n   3800,\n   4200,\n   9800,\n   4800,\n   9000,\n   3700,\n   8000,\n   14000,\n   11000,\n   5000,\n   6800,\n   14000,\n   8000,\n   6000,\n   6300,\n   20000,\n   5220,\n   6800,\n   4000,\n   4200,\n   6000,\n   3800,\n   20000,\n   5220,\n   5300,\n   7500,\n   7500,\n   4200,\n   14000,\n   11000,\n   8000,\n   6000,\n   5000,\n   3500,\n   3000,\n   9200,\n   3690,\n   8500,\n   5500,\n   3300,\n   1830,\n   5000,\n   4500,\n   8500,\n   55000,\n   2660,\n   1630,\n   11000,\n   6200,\n   5400,\n   8800,\n   5400,\n   15000,\n   1430,\n   8500,\n   1730,\n   1690,\n   5300,\n   13000,\n   10000,\n   2390,\n   4600,\n   2130,\n   7200,\n   7300,\n   6500,\n   3000,\n   17000,\n   6690,\n   4260,\n   8800,\n   5800,\n   5300,\n   4300,\n   6800,\n   10500,\n   2300,\n   2600,\n   1500,\n   7130,\n   7800,\n   16800,\n   4300,\n   1300,\n   7000,\n   1500,\n   5800,\n   1630,\n   4900,\n   2390,\n   4800,\n   4600,\n   2060,\n   5800,\n   8200,\n   1730,\n   2460,\n   2800,\n   2330,\n   2690,\n   2630,\n   6800,\n   2090,\n   2130,\n   3500,\n   7000,\n   1790,\n   1730,\n   1090,\n   7000,\n   21000,\n   9500,\n   6000,\n   5200,\n   15000,\n   2700,\n   13000,\n   6400,\n   2030,\n   2130,\n   5800,\n   1660,\n   7000,\n   7000,\n   9000,\n   2060,\n   8000,\n   4000,\n   6800,\n   6800,\n   5300,\n   7200,\n   3000,\n   1890,\n   9500,\n   5200,\n   1360,\n   5500,\n   5800,\n   6000,\n   5000,\n   2230,\n   5500,\n   1700,\n   2900,\n   2200,\n   2200,\n   5000,\n   8000,\n   1690,\n   4800,\n   4800,\n   14000,\n   12000,\n   4200,\n   4990,\n   5000,\n   4500,\n   5800,\n   8500,\n   5000,\n   3000,\n   3600,\n   5000,\n   5500,\n   4600,\n   3760,\n   13000,\n   2660,\n   7000,\n   2790,\n   12500,\n   3700,\n   2630,\n   4500,\n   1530,\n   3600,\n   6200,\n   6200,\n   2060,\n   12000,\n   8500,\n   8000,\n   9200,\n   2400,\n   2030,\n   1500,\n   4500,\n   7130,\n   4600,\n   4300,\n   5300,\n   3500,\n   1300,\n   7000,\n   8500,\n   9500,\n   3400,\n   3500,\n   3200,\n   10000,\n   6300,\n   23000,\n   4200,\n   15000,\n   6500,\n   4600,\n   1830,\n   20000,\n   2066,\n   3000,\n   4900,\n   8200,\n   6000,\n   12000,\n   2900,\n   3100,\n   1760,\n   1260,\n   2130,\n   6200,\n   1730,\n   5000,\n   9000,\n   7200,\n   12000,\n   3500,\n   1460,\n   6000,\n   5400,\n   12000,\n   6800,\n   7000,\n   7000,\n   2390,\n   6300,\n   4200,\n   1790,\n   6000,\n   1980,\n   5300,\n   8800,\n   7800,\n   4500,\n   9000,\n   6500,\n   5000,\n   4300,\n   8200,\n   4200,\n   16000,\n   2600,\n   5500,\n   5800,\n   5500,\n   6500,\n   3600,\n   6500,\n   2090,\n   5500,\n   5000,\n   2130,\n   6500,\n   1660,\n   3690,\n   2490,\n   2800,\n   2800,\n   12800,\n   4000,\n   6000,\n   5500,\n   5800,\n   9500,\n   5600,\n   5500,\n   5800,\n   7600,\n   6000,\n   9500,\n   7000,\n   7000,\n   4000,\n   11200,\n   13000,\n   10000,\n   18000,\n   6500,\n   35000,\n   24500,\n   16000,\n   2600,\n   5500,\n   5800,\n   5500,\n   6500,\n   3690,\n   7000,\n   6500,\n   6000,\n   7800,\n   3000,\n   2090,\n   7200,\n   2400,\n   5090,\n   6800,\n   6330,\n   5300,\n   3660,\n   2800,\n   1090,\n   1890,\n   1730,\n   3590,\n   1700,\n   4530,\n   4000,\n   6800,\n   4700,\n   2260,\n   1390,\n   4500,\n   1790,\n   2190,\n   4200,\n   4000,\n   4500,\n   2560,\n   1790,\n   4200,\n   1590,\n   9500,\n   10500,\n   3500,\n   6000,\n   2230,\n   2124,\n   6000,\n   3000,\n   1872,\n   6800,\n   1790,\n   5500,\n   2030,\n   11000,\n   2460,\n   7000,\n   10000,\n   8300,\n   4500,\n   1690,\n   4500,\n   17000,\n   3100,\n   1530,\n   6000,\n   3500,\n   11000,\n   25000,\n   15000,\n   3260,\n   1730,\n   1590,\n   1790,\n   5650,\n   7500,\n   26000,\n   6000,\n   72000,\n   4300,\n   72000,\n   5200,\n   4800,\n   4300,\n   4300,\n   5500,\n   1760,\n   4000,\n   3000,\n   7000,\n   13000,\n   6600,\n   8000,\n   5500,\n   5500,\n   8000,\n   5600,\n   2150,\n   4400,\n   2290,\n   1899,\n   8200,\n   7600,\n   5800,\n   1630,\n   2300,\n   16800,\n   6000,\n   2280,\n   6000,\n   1830,\n   1577,\n   8500,\n   6000,\n   7350,\n   6300,\n   3000,\n   15500,\n   5500,\n   7200,\n   4900,\n   8000,\n   11000,\n   8400,\n   14000,\n   14000,\n   3300,\n   30000,\n   4800,\n   11300,\n   6800,\n   8600,\n   2060,\n   2800,\n   2090,\n   6800,\n   4000,\n   13000,\n   3690,\n   3490,\n   3800,\n   5800,\n   35000,\n   6300,\n   40000,\n   4500,\n   5500,\n   6300,\n   2900,\n   26000,\n   9000,\n   5500,\n   1290,\n   2890,\n   4500,\n   2530,\n   3000,\n   2200,\n   1630,\n   6500,\n   3630,\n   1330,\n   5500,\n   7500,\n   6400,\n   3800,\n   2600,\n   2300,\n   6800,\n   3900,\n   9890,\n   2090,\n   2000,\n   6200,\n   7690,\n   11000,\n   3000,\n   6000,\n   1960,\n   3800,\n   5500,\n   1630,\n   4000,\n   2790,\n   6000,\n   1890,\n   1630,\n   19800,\n   5000,\n   6000,\n   9500,\n   2460,\n   7800,\n   3000,\n   7500,\n   5800,\n   1360,\n   13000,\n   4000,\n   7800,\n   7500,\n   6600,\n   7000,\n   10000,\n   1690,\n   1700,\n   11500,\n   1760,\n   1387,\n   16000,\n   1960,\n   19000,\n   26000,\n   1990,\n   22000,\n   6000,\n   3500,\n   7000,\n   5300,\n   9500,\n   4000,\n   3800,\n   6600,\n   6000,\n   2960,\n   1590,\n   1990,\n   1890,\n   3800,\n   20000,\n   7200,\n   5000,\n   2400,\n   7000,\n   2290,\n   4500,\n   4500,\n   2660,\n   1430,\n   4830,\n   2390,\n   2060,\n   4200,\n   3800,\n   3130,\n   1800,\n   4500,\n   14000,\n   6000,\n   10000,\n   4000,\n   1590,\n   1560,\n   3200,\n   150000,\n   6800,\n   3800,\n   8000,\n   5600,\n   6500,\n   5600,\n   7200,\n   10000,\n   2090,\n   3000,\n   2660,\n   15500,\n   1460,\n   6000,\n   6500,\n   6300,\n   1930,\n   4500,\n   3660,\n   6200,\n   42000,\n   2500,\n   13000,\n   35000,\n   3330,\n   1460,\n   5100,\n   7000,\n   7800,\n   5200,\n   6900,\n   2400,\n   5000,\n   4800,\n   4800,\n   15000,\n   9600,\n   18000,\n   2060,\n   5000,\n   1230,\n   3590,\n   4000,\n   1690,\n   1900,\n   3500,\n   2390,\n   3600,\n   1830,\n   8000,\n   4060,\n   3600,\n   6300,\n   20000,\n   27000,\n   2500,\n   1830,\n   118000,\n   8500,\n   6800,\n   1830,\n   7500,\n   2280,\n   5290,\n   1530,\n   2400,\n   8500,\n   3300,\n   2400,\n   4230,\n   4300,\n   6200,\n   4600,\n   2090,\n   3300,\n   7300,\n   2190,\n   2190,\n   6300,\n   15500,\n   2490,\n   5000,\n   1830,\n   6000,\n   1790,\n   3800,\n   36000,\n   5690,\n   8500,\n   3000,\n   27000,\n   7500,\n   2400,\n   4030,\n   3300,\n   3300,\n   4000,\n   35000,\n   1760,\n   28000,\n   13500,\n   2090,\n   3200,\n   2060,\n   2800,\n   2460,\n   2300,\n   4600,\n   5650,\n   3500,\n   72000,\n   4800,\n   6800,\n   6500,\n   6360,\n   7500,\n   2700,\n   2500,\n   9500,\n   6100,\n   4800,\n   3900,\n   6000,\n   3800,\n   3230,\n   2800,\n   9000,\n   21000,\n   4790,\n   1590,\n   7500,\n   7000,\n   1990,\n   8500,\n   2360,\n   2030,\n   3130,\n   6500,\n   8800,\n   4000,\n   23000,\n   3500,\n   5300,\n   4000,\n   6500,\n   8600,\n   7200,\n   1860,\n   1760,\n   35000,\n   6200,\n   4000,\n   2130,\n   2200,\n   2000,\n   1387,\n   9600,\n   1800,\n   3200,\n   4500,\n   1700,\n   26800,\n   7600,\n   5330,\n   2060,\n   1957,\n   3900,\n   18000,\n   1590,\n   8200,\n   8900,\n   4900,\n   10500,\n   4000,\n   3800,\n   2760,\n   8000,\n   2630,\n   6800,\n   2390,\n   1830,\n   1600,\n   1800,\n   5500,\n   13500,\n   2560,\n   1630,\n   3600,\n   3600,\n   11000,\n   3800,\n   4500,\n   5000,\n   9900,\n   3800,\n   7500,\n   1490,\n   1660,\n   5500,\n   24000,\n   7200,\n   8500,\n   2760,\n   2998,\n   2630,\n   2390,\n   1830,\n   4700,\n   10500,\n   2560,\n   9500,\n   3600,\n   9000,\n   16800,\n   3900,\n   3230,\n   3500,\n   11000,\n   4000,\n   1690,\n   2030,\n   13500,\n   4200,\n   7700,\n   3000,\n   10950,\n   2390,\n   5200,\n   5200,\n   1690,\n   4300,\n   2390,\n   4900,\n   4200,\n   3500,\n   1760,\n   6500,\n   7000,\n   2290,\n   4700,\n   20000,\n   13000,\n   4500,\n   2100,\n   12800,\n   7800,\n   4500,\n   9000,\n   2030,\n   1860,\n   2700,\n   4000,\n   2160,\n   30000,\n   3100,\n   3800,\n   5700,\n   2130,\n   7200,\n   5500,\n   2300,\n   7100,\n   8000,\n   6800,\n   1600,\n   1800,\n   5500,\n   13500,\n   3600,\n   3600,\n   11000,\n   3130,\n   9000,\n   5400,\n   4200,\n   4300,\n   5000,\n   4000,\n   5000,\n   4500,\n   6600,\n   4600,\n   6500,\n   4800,\n   1430,\n   4500,\n   1830,\n   15000,\n   16000,\n   3800,\n   1590,\n   3300,\n   16000,\n   8500,\n   9800,\n   2990,\n   16000,\n   6850,\n   6800,\n   8000,\n   8600,\n   1560,\n   3500,\n   6000,\n   30000,\n   11500,\n   6800,\n   7800,\n   12000,\n   6000,\n   50000,\n   3800,\n   5000,\n   50000,\n   3000,\n   4200,\n   3200,\n   8000,\n   9500,\n   4700,\n   7600,\n   6200,\n   3000,\n   4400,\n   4700,\n   3200,\n   4060,\n   150000,\n   6800,\n   3800,\n   24000,\n   29000,\n   1960,\n   1590,\n   5660,\n   2260,\n   3190,\n   1890,\n   1660,\n   2460,\n   7000,\n   2860,\n   2100,\n   7800,\n   17000,\n   2800,\n   2700,\n   1630,\n   4500,\n   2760,\n   1330,\n   4680,\n   18000,\n   4500,\n   5500,\n   1890,\n   9800,\n   2560]]}"
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# floor,price 箱线图\n",
    "df_box = df[df['floor'] != '无'][['floor', 'price']].groupby('floor')\n",
    "label = [i[0] for i in df_box]\n",
    "data = [[j[1] for j in i[1].values] for i in df_box]\n",
    "{\n",
    "    'label': label,\n",
    "    'data': data\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-28T12:39:31.269939400Z",
     "start_time": "2023-12-28T12:39:31.235234800Z"
    }
   },
   "id": "9484034cb88fef69"
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "outputs": [
    {
     "data": {
      "text/plain": "{'data': [{'name': '精装', 'value': 2600},\n  {'name': '近地铁', 'value': 1818},\n  {'name': '随时看房', 'value': 1335},\n  {'name': '双卫生间', 'value': 708},\n  {'name': '公寓', 'value': 677},\n  {'name': '月租', 'value': 351},\n  {'name': '独栋公寓', 'value': 307},\n  {'name': '开放厨房', 'value': 287},\n  {'name': '有阳台', 'value': 239},\n  {'name': '拎包入住', 'value': 204},\n  {'name': '押一付一', 'value': 166},\n  {'name': '独立阳台', 'value': 128},\n  {'name': '独立卫生间', 'value': 70},\n  {'name': '新上', 'value': 67},\n  {'name': '租住保障', 'value': 42},\n  {'name': '官方核验', 'value': 7},\n  {'name': '业主自荐', 'value': 5},\n  {'name': '首次出租', 'value': 1}]}"
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# tags 词云图\n",
    "words = [j for i in df[df['tags'] != '无']['tags'].values for j in str(i).split('|')]\n",
    "df_words = pd.DataFrame({'word': words})\n",
    "df_words_count = df_words['word'].value_counts().reset_index()\n",
    "data = [{'name': i[0], 'value': i[1]} for i in df_words_count.values]\n",
    "{\n",
    "    'data': data\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-28T12:39:31.337981400Z",
     "start_time": "2023-12-28T12:39:31.271933500Z"
    }
   },
   "id": "9c7f4f015db7e6bd"
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "outputs": [
    {
     "data": {
      "text/plain": "{'data': [{'name': '南山区', 'value': 758},\n  {'name': '福田区', 'value': 578},\n  {'name': '龙岗区', 'value': 396},\n  {'name': '宝安区', 'value': 281},\n  {'name': '罗湖区', 'value': 269},\n  {'name': '龙华区', 'value': 157},\n  {'name': '坪山区', 'value': 96},\n  {'name': '盐田区', 'value': 84},\n  {'name': '光明区', 'value': 63},\n  {'name': '鹏新区', 'value': 11}]}"
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# address 地图\n",
    "df_region = df[df['address'] != '无']['address'].apply(lambda x: x.split('-')[0])\n",
    "df_map = df_region.value_counts().reset_index()\n",
    "data = [{'name': i[0], 'value': i[1]} for i in df_map.values]\n",
    "{\n",
    "    'data': data\n",
    "}"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-28T12:39:31.338978200Z",
     "start_time": "2023-12-28T12:39:31.282955200Z"
    }
   },
   "id": "ce5e229f001c0a6"
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "outputs": [
    {
     "data": {
      "text/plain": "[[0, 0, 98],\n [1, 0, 85],\n [2, 0, 74],\n [3, 0, 96],\n [0, 1, 306],\n [1, 1, 210],\n [2, 1, 109],\n [3, 1, 88],\n [0, 2, 223],\n [1, 2, 191],\n [2, 2, 98],\n [3, 2, 53],\n [0, 3, 193],\n [1, 3, 134],\n [2, 3, 52],\n [3, 3, 29],\n [0, 4, 75],\n [1, 4, 74],\n [2, 4, 22],\n [3, 4, 19],\n [0, 5, 54],\n [1, 5, 28],\n [2, 5, 12],\n [3, 5, 7],\n [0, 6, 34],\n [1, 6, 21],\n [2, 6, 8],\n [3, 6, 3],\n [0, 7, 27],\n [1, 7, 18],\n [2, 7, 9],\n [3, 7, 3],\n [0, 8, 18],\n [1, 8, 12],\n [2, 8, 3],\n [3, 8, 2],\n [0, 9, 7],\n [1, 9, 8],\n [2, 9, 6],\n [3, 9, 0]]"
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# face,price 热力图\n",
    "face_list = df[df['face'] != '无']['face'].unique().tolist()\n",
    "price_list = [f'{2000 * i}-{2000 * (i + 1)}' for i in range(0, 10)]\n",
    "[[j, i, len(df[(df['price'] > 2000 * i) & (df['price'] <= 2000 * (i + 1)) & (df['face'] == face_list[j])])] for i in\n",
    " range(0, 10) for j in range(len(face_list))]"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-28T12:46:23.815347100Z",
     "start_time": "2023-12-28T12:46:23.774677700Z"
    }
   },
   "id": "876218d772394260"
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "outputs": [
    {
     "data": {
      "text/plain": "['0-2000',\n '2000-4000',\n '4000-6000',\n '6000-8000',\n '8000-10000',\n '10000-12000',\n '12000-14000',\n '14000-16000',\n '16000-18000',\n '18000-20000']"
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "price_list"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-28T12:46:28.058649600Z",
     "start_time": "2023-12-28T12:46:28.052931200Z"
    }
   },
   "id": "ef3f47f618e2c493"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
